package com.behavior.visitor.example.visitor.impl;

import com.behavior.visitor.example.user.impl.Student;
import com.behavior.visitor.example.user.impl.Teacher;
import com.behavior.visitor.example.visitor.Visitor;

/**
 * <p></p>
 *
 * @author jiuhua.xu
 * @version 1.0
 * @since JDK 1.8
 */
public class Parent implements Visitor {


    @Override
    public void visit(Student student) {

        System.out.printf("\r\n学生信息 姓名：%s 班级：%s 排名：%s", student.name, student.clazz, student.ranking());
    }

    @Override
    public void visit(Teacher teacher) {
        System.out.printf("\r\n老师信息 姓名：%s 班级：%s 级别：%s", teacher.name, teacher.clazz, teacher.identity);
    }
}
